﻿using GraphProcessor;
using IQIGame.Onigao.Logic;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay.Editors
{
    [System.Serializable, NodeMenuItem(LevelEditorConst.Execution + "/" + LevelEditorConst.StartItemSubmit, typeof(LevelServiceGraph))]
    public class LevelServiceExecutionNode_StartItemSubmit : LevelServiceExecutionNode
    {
        protected override ServiceExecutionType mServiceType => ServiceExecutionType.StartItemSubmit;
        public override string name => LevelEditorConst.StartItemSubmit;
        [LevelServiceEditorCustomProperty(ServiceExecutionType.StartItemSubmit, "LevelItemSubmit表ID")]
        public int cid;

        protected override LevelServiceCustomConfig CreateConfig()
        {
            var rConfig = new LevelServiceExecutionCustom_StartItemSubmit()
            {
                cid = this.cid
            };
            return rConfig;
        }

        protected override void OnSync(EditorLevelServiceExecutionConfig newConfig, LevelServiceExecutionNode tempNode)
        {
            if (tempNode is LevelServiceExecutionNode_StartItemSubmit rNode)
            {
                this.cid = rNode.cid;
            }
        }
    }
}